package homework;/*
 *ClassName:test15_1
 *UserName:zhang
 *CreateTime:2020/9/15 10:40
 */

public class test15_1 {

    //素数：100-999只能被1和本身整除的称为素数；


        public static void main(String[] args) {
            for (int i = 100; i <999; i++) {//循环判断100-999
                boolean prime = true;//定义一个数，用来存放素数
                for (int j = 2; j <i; j++) {
                    if(i%j==0) {
                        prime = false;
                        break;
                    }
                }
                if(prime==true){
                    System.out.println(i+"为素数");
                }

             }
        }
}